from django.contrib import admin

# Register your models here.
from .models import pfmea_table_info, pfmea_table_data


# admin.site.register(pfmea_table_info, pfmea_table_data)
@admin.register(pfmea_table_info)
class pfmea_table_info_Admin(admin.ModelAdmin):
    list_display = [
        "base",
        "base_zone",
        "pfmea_number",
        "partNumber",
        "partName",
        "responsibility",
        "keyDate",
        "editDate",
        "editor",
        "coreTeam",
        "version",
    ]
    search_fields = list_display
    list_filter = list_display
    # 设置哪些字段可以点击进入编辑界面
    list_display_links = ("base", "base_zone")


@admin.register(pfmea_table_data)
class pfmea_table_data_Admin(admin.ModelAdmin):
    list_display = [
        "pfmea_op",
        "ProcessFunction",
        "PotentialFailureMode",
        "PotentialEffectsOfFailure",
    ]
    search_fields = list_display
    list_filter = list_display
